package com.itgaoshu.hospitalproject.mapper;

import com.itgaoshu.hospitalproject.bean.Registeredtype;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface RegisteredtypeMapper {
    //查询所有挂号类型的方法
    List<Registeredtype> registeredTypeList(String type);
    //添加挂号类型的方法
    @Insert("insert into registeredtype values(null,#{type},#{price})")
    int addRegisteredType(Registeredtype registeredtype);
    //查看这个类型存不存在
    @Select("select count(*) from registeredtype where type=#{type}")
    int count(Registeredtype registeredtype);
    //修改挂号类型的方法
    @Update("update registeredtype set type=#{type},price=#{price} where registeredId=#{registeredId}")
    int editRegisteredType(Registeredtype registeredtype);
}














